import request from '@/utils/request'

// 获得所有设备编号下的数据
export function getDataByDeviceCode (deviceCode) {
  return request({
    url: '/temHumData/getDataByDeviceCode',
    method: 'get',
    params: { deviceCode }
  })
}

//模糊分页查询
export function getDataByDeviceCodePage (deviceCode, bigTem, smlTem, bigHum, smlHum, bigAdcx, smlAdcx, beep, led, bigCreateTime, smlCreateTime) {
  return request({
    url: '/temHumData/getDataByDeviceCodePage',
    method: 'get',
    params: {
      deviceCode,
      bigTem,
      smlTem,
      bigHum,
      smlHum,
      bigAdcx,
      smlAdcx,
      beep,
      led,
      bigCreateTime,
      smlCreateTime
    }
  })
}

//模糊分页查询结果导出
export function download (deviceCode, bigTem, smlTem, bigHum, smlHum, bigAdcx, smlAdcx, beep, led, bigCreateTime, smlCreateTime) {
  return request({
    url: '/temHumData/download',
    method: 'get',
    params: {
      deviceCode,
      bigTem,
      smlTem,
      bigHum,
      smlHum,
      bigAdcx,
      smlAdcx,
      beep,
      led,
      bigCreateTime,
      smlCreateTime
    }
  })
}

//根据ID逻辑删除
export function deleteById (id) {
  return request({
    url: '/temHumData/deleteById',
    method: 'get',
    params: { id }
  })
}

//获取时间范围内的数据
export function zheXianTuShowTem (deviceCode, bigCreateTime, smlCreateTime) {
  return request({
    url: '/temHumData/zheXianTuShowTem',
    method: 'get',
    params: {
      deviceCode,
      bigCreateTime,
      smlCreateTime
    }
  })
}
